Optimal. Leaf size=141 \[ \frac {a (e x)^{2 n}}{2 e n}-\frac {2 b x^{-n} (e x)^{2 n} \tanh ^{-1}\left (e^{i \left (c+d x^n\right )}\right )}{d e n}+\frac {i b x^{-2 n} (e x)^{2 n} \text {PolyLog}\left (2,-e^{i \left (c+d x^n\right )}\right )}{d^2 e n}-\frac {i b x^{-2 n} (e x)^{2 n} \text {PolyLog}\left (2,e^{i \left (c+d x^n\right )}\right )}{d^2 e n} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 141, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 6, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {14, 4294, 4290,
4268, 2317, 2438} \begin {gather*} \frac {a (e x)^{2 n}}{2 e n}+\frac {i b x^{-2 n} (e x)^{2 n} \text {Li}_2\left (-e^{i \left (d x^n+c\right )}\right )}{d^2 e n}-\frac {i b x^{-2 n} (e x)^{2 n} \text {Li}_2\left (e^{i \left (d x^n+c\right )}\right )}{d^2 e n}-\frac {2 b x^{-n} (e x)^{2 n} \tanh ^{-1}\left (e^{i \left (c+d x^n\right )}\right )}{d e n} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 2317
Rule 2438
Rule 4268
Rule 4290
Rule 4294
Rubi steps
\begin {align*} \int (e x)^{-1+2 n} \left (a+b \csc \left (c+d x^n\right )\right ) \, dx &=\int \left (a (e x)^{-1+2 n}+b (e x)^{-1+2 n} \csc \left (c+d x^n\right )\right ) \, dx\\ &=\frac {a (e x)^{2 n}}{2 e n}+b \int (e x)^{-1+2 n} \csc \left (c+d x^n\right ) \, dx\\ &=\frac {a (e x)^{2 n}}{2 e n}+\frac {\left (b x^{-2 n} (e x)^{2 n}\right ) \int x^{-1+2 n} \csc \left (c+d x^n\right ) \, dx}{e}\\ &=\frac {a (e x)^{2 n}}{2 e n}+\frac {\left (b x^{-2 n} (e x)^{2 n}\right ) \text {Subst}\left (\int x \csc (c+d x) \, dx,x,x^n\right )}{e n}\\ &=\frac {a (e x)^{2 n}}{2 e n}-\frac {2 b x^{-n} (e x)^{2 n} \tanh ^{-1}\left (e^{i \left (c+d x^n\right )}\right )}{d e n}-\frac {\left (b x^{-2 n} (e x)^{2 n}\right ) \text {Subst}\left (\int \log \left (1-e^{i (c+d x)}\right ) \, dx,x,x^n\right )}{d e n}+\frac {\left (b x^{-2 n} (e x)^{2 n}\right ) \text {Subst}\left (\int \log \left (1+e^{i (c+d x)}\right ) \, dx,x,x^n\right )}{d e n}\\ &=\frac {a (e x)^{2 n}}{2 e n}-\frac {2 b x^{-n} (e x)^{2 n} \tanh ^{-1}\left (e^{i \left (c+d x^n\right )}\right )}{d e n}+\frac {\left (i b x^{-2 n} (e x)^{2 n}\right ) \text {Subst}\left (\int \frac {\log (1-x)}{x} \, dx,x,e^{i \left (c+d x^n\right )}\right )}{d^2 e n}-\frac {\left (i b x^{-2 n} (e x)^{2 n}\right ) \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{i \left (c+d x^n\right )}\right )}{d^2 e n}\\ &=\frac {a (e x)^{2 n}}{2 e n}-\frac {2 b x^{-n} (e x)^{2 n} \tanh ^{-1}\left (e^{i \left (c+d x^n\right )}\right )}{d e n}+\frac {i b x^{-2 n} (e x)^{2 n} \text {Li}_2\left (-e^{i \left (c+d x^n\right )}\right )}{d^2 e n}-\frac {i b x^{-2 n} (e x)^{2 n} \text {Li}_2\left (e^{i \left (c+d x^n\right )}\right )}{d^2 e n}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.24, size = 185, normalized size = 1.31 \begin {gather*} \frac {x^{-2 n} (e x)^{2 n} \left (a d^2 x^{2 n}+2 b c \log \left (1-e^{i \left (c+d x^n\right )}\right )+2 b d x^n \log \left (1-e^{i \left (c+d x^n\right )}\right )-2 b c \log \left (1+e^{i \left (c+d x^n\right )}\right )-2 b d x^n \log \left (1+e^{i \left (c+d x^n\right )}\right )-2 b c \log \left (\tan \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )+2 i b \text {PolyLog}\left (2,-e^{i \left (c+d x^n\right )}\right )-2 i b \text {PolyLog}\left (2,e^{i \left (c+d x^n\right )}\right )\right )}{2 d^2 e n} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 0.26, size = 699, normalized size = 4.96
method | result | size |
risch | \(\frac {a x \,{\mathrm e}^{\frac {\left (-1+2 n \right ) \left (-i \mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right ) \pi +i \mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i e x \right )^{2} \pi +i \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )^{2} \pi -i \mathrm {csgn}\left (i e x \right )^{3} \pi +2 \ln \left (e \right )+2 \ln \left (x \right )\right )}{2}}}{2 n}+\frac {e^{2 n} b \ln \left (1-{\mathrm e}^{i \left (c +d \,x^{n}\right )}\right ) x^{n} \left (-1\right )^{\frac {\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )}{2}} {\mathrm e}^{\frac {i \pi \,\mathrm {csgn}\left (i e x \right ) \left (-2 n \mathrm {csgn}\left (i e x \right )^{2}+2 n \,\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i e x \right )+2 n \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )-2 n \,\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i x \right )+\mathrm {csgn}\left (i e x \right )^{2}-\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i e x \right )-\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )\right )}{2}}}{d n e}-\frac {e^{2 n} b \ln \left ({\mathrm e}^{i \left (c +d \,x^{n}\right )}+1\right ) x^{n} \left (-1\right )^{\frac {\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )}{2}} {\mathrm e}^{\frac {i \pi \,\mathrm {csgn}\left (i e x \right ) \left (-2 n \mathrm {csgn}\left (i e x \right )^{2}+2 n \,\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i e x \right )+2 n \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )-2 n \,\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i x \right )+\mathrm {csgn}\left (i e x \right )^{2}-\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i e x \right )-\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )\right )}{2}}}{d n e}-\frac {i e^{2 n} b \dilog \left (1-{\mathrm e}^{i \left (c +d \,x^{n}\right )}\right ) \left (-1\right )^{\frac {\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )}{2}} {\mathrm e}^{\frac {i \pi \,\mathrm {csgn}\left (i e x \right ) \left (-2 n \mathrm {csgn}\left (i e x \right )^{2}+2 n \,\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i e x \right )+2 n \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )-2 n \,\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i x \right )+\mathrm {csgn}\left (i e x \right )^{2}-\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i e x \right )-\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )\right )}{2}}}{d^{2} n e}+\frac {i e^{2 n} b \dilog \left ({\mathrm e}^{i \left (c +d \,x^{n}\right )}+1\right ) \left (-1\right )^{\frac {\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )}{2}} {\mathrm e}^{\frac {i \pi \,\mathrm {csgn}\left (i e x \right ) \left (-2 n \mathrm {csgn}\left (i e x \right )^{2}+2 n \,\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i e x \right )+2 n \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )-2 n \,\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i x \right )+\mathrm {csgn}\left (i e x \right )^{2}-\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i e x \right )-\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )\right )}{2}}}{d^{2} n e}\) | \(699\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 371 vs. \(2 (131) = 262\).
time = 3.14, size = 371, normalized size = 2.63 \begin {gather*} \frac {a d^{2} x^{2 \, n} e^{\left (2 \, n - 1\right )} - b d x^{n} e^{\left (2 \, n - 1\right )} \log \left (\cos \left (d x^{n} + c\right ) + i \, \sin \left (d x^{n} + c\right ) + 1\right ) - b d x^{n} e^{\left (2 \, n - 1\right )} \log \left (\cos \left (d x^{n} + c\right ) - i \, \sin \left (d x^{n} + c\right ) + 1\right ) - b c e^{\left (2 \, n - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (d x^{n} + c\right ) + \frac {1}{2} i \, \sin \left (d x^{n} + c\right ) + \frac {1}{2}\right ) - b c e^{\left (2 \, n - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (d x^{n} + c\right ) - \frac {1}{2} i \, \sin \left (d x^{n} + c\right ) + \frac {1}{2}\right ) - i \, b {\rm Li}_2\left (\cos \left (d x^{n} + c\right ) + i \, \sin \left (d x^{n} + c\right )\right ) e^{\left (2 \, n - 1\right )} + i \, b {\rm Li}_2\left (\cos \left (d x^{n} + c\right ) - i \, \sin \left (d x^{n} + c\right )\right ) e^{\left (2 \, n - 1\right )} - i \, b {\rm Li}_2\left (-\cos \left (d x^{n} + c\right ) + i \, \sin \left (d x^{n} + c\right )\right ) e^{\left (2 \, n - 1\right )} + i \, b {\rm Li}_2\left (-\cos \left (d x^{n} + c\right ) - i \, \sin \left (d x^{n} + c\right )\right ) e^{\left (2 \, n - 1\right )} + {\left (b d x^{n} e^{\left (2 \, n - 1\right )} + b c e^{\left (2 \, n - 1\right )}\right )} \log \left (-\cos \left (d x^{n} + c\right ) + i \, \sin \left (d x^{n} + c\right ) + 1\right ) + {\left (b d x^{n} e^{\left (2 \, n - 1\right )} + b c e^{\left (2 \, n - 1\right )}\right )} \log \left (-\cos \left (d x^{n} + c\right ) - i \, \sin \left (d x^{n} + c\right ) + 1\right )}{2 \, d^{2} n} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (e x\right )^{2 n - 1} \left (a + b \csc {\left (c + d x^{n} \right )}\right )\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \left (a+\frac {b}{\sin \left (c+d\,x^n\right )}\right )\,{\left (e\,x\right )}^{2\,n-1} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________